Skip to main content
Ped/NPC Dialogues

Client exports

Start or stop active dialogues and manage dialogue NPCs from client-side resources.

API reference

Dialogue controls

Start a dialogue with a specified NPC or stop the currently active dialogue.

2 exports
exports["resource_name"]:Start(ped, dialogueID)

Starts the specified dialogue with the specified NPC or ped.

pednumber (ped handle)dialogueIDstring
exports["resource_name"]:Stop()

Stops the dialogue that is currently active.

None
API reference

Ped management

Create, remove and retrieve dialogue NPCs from the available ped pools.

6 exports
exports["resource_name"]:All()

Returns all dialogue NPCs from the pool.

None
PedEntry[]
exports["resource_name"]:AllStreamed()

Returns all streamed dialogue NPCs from the streamed pool.

None
PedEntry[]
exports["resource_name"]:CreateOne(ctx)

Creates a dialogue NPC asynchronously.

ctxtable (PedCreateConstructor)
number
exports["resource_name"]:DeleteOne(id)

Destroys a dialogue NPC.

idnumber
exports["resource_name"]:Get(id)

Returns the dialogue NPC with the specified ID.

idnumber
PedEntry | nil
exports["resource_name"]:GetClosestPedToCoords(coords, maxRange, onlyStreamed)

Returns the closest dialogue ped to the specified coordinates.

coordsvector3maxRangenumberonlyStreamedboolean
PedEntry | nil

PedCreateConstructor

dialogueIDstring

positionvector3

headingnumber

questionMark?boolean

name?string

You do not need to use the included ped creator to use the dialogue system. If you already have a custom ped system with interactions, you can use the dialogue export functions directly.